package com.mtzqc.glide;

import androidx.annotation.NonNull;

import com.bumptech.glide.annotation.GlideExtension;
import com.bumptech.glide.annotation.GlideOption;
import com.bumptech.glide.request.BaseRequestOptions;
import com.mtzqc.kt.GlideKtKt;

/**
 * @author czw
 */
@GlideExtension
public class GlideExtensionImpl {
    private GlideExtensionImpl() {

    }

    @NonNull
    @GlideOption
    public static BaseRequestOptions<?> applyAvatar(BaseRequestOptions<?> options) {
        return applyCircle(options);
    }

    @NonNull
    @GlideOption
    public static BaseRequestOptions<?> applyCircle(BaseRequestOptions<?> options) {
        return options
                .error(GlideKtKt.getIMAGE_ERROR_RESOURCE())
                .centerCrop()
                .circleCrop();
    }
}
